---
title: "Aggregation - Filtering"
enterprise: true
---
Filtering can be configured to impact aggregate values in the grid.

## Ignore Filters when Aggregating
When using [Filters](./filtering-overview/) and [Aggregations](./aggregation/) together, the aggregated values reflect
only the rows which have passed the filter. This can be changed to instead ignore applied filters by using the
`suppressAggFilteredOnly` grid option.

{% gridExampleRunner title="Aggregation and Filters" name="filters" /%}

The example above demonstrates the impact of the `suppressAggFilteredOnly` grid option. This can be enabled as shown:
```{% frameworkTransform=true %}
const gridOptions = {
    suppressAggFilteredOnly: true,
}
```

## Filtering for Aggregated Values
The grid only applies filters to leaf level rows, this can be toggled to instead also apply filtering
to group rows by enabling the `groupAggFiltering` grid option, allowing filters to also apply against
the aggregated values.

{% gridExampleRunner title="Group and Leaf Aggregate Filtering" name="agg-filtering-all" /%}

{% note %}
Take note of the following while using `groupAggFiltering`:
- When a group row passes a filter, it also includes all of its descendent rows in the filtered results.
- The `suppressAggFilteredOnly` grid option will be implicitly enabled.
- [Set Filters](./filter-set/) will only work with leaf rows.
{% /note %}

The following configuration demonstrates how to enable group aggregation filtering:
```{% frameworkTransform=true %}
const gridOptions = {
    groupAggFiltering: true,
}
```

### Configure by Callback
When filtering for aggregated values the filter applies to all group rows by default. This can be configured more
granularly by instead providing the `groupAggFiltering` grid option with a callback function.

The example below demonstrates a grid configured to apply filters only to aggregated values, and not the leaf rows:
{% gridExampleRunner title="Group-Only Aggregate Filtering" name="agg-filtering-group" /%}

The configuration below demonstrates how to only apply test filters against group rows, and not leaf rows:
```{% frameworkTransform=true %}
const gridOptions = {
    groupAggFiltering: (params) => !!params.node.group,
}
```
